<template>
<uni-shadow-root class="partials-form_item-index"><block v-if="formCommitItem&&formCommitItem.belongFormType == 0&&(!formListStyle||formListStyle.length==0)&&!controlLimitState&&bannerList&&setting">
    <view class="form_commit_item" @click.stop.prevent="checkFormDetail" :data-id="formCommitItem.id">
      <view class="form_title">
        <view class="form_title_left">
          <image class="user_icon" :src="(formCommitItem.commitPlatformUserIcon)+'?x-oss-process=style/preview_120'"></image>
          <text class="user_name">{{formCommitItem.commitPlatformUserName}}</text>
        </view>
        <view class="form_title_right">
          <text class="form_type">[表单]</text>
          <text class="form_name">{{formCommitItem.belongFormName}}</text>
        </view>
      </view>
      <view class="form_description">
        <image class="form_state_icon" v-if="formCommitItem.recordStatus==1" src="https://image1.sansancloud.com/xianhua/2018_11/14/21/20/50_605.jpg?x-oss-process=style/preview_120"></image>
        <image class="form_state_icon" v-if="formCommitItem.recordStatus==0" src="https://image1.sansancloud.com/xianhua/2018_11/14/21/24/17_402.jpg?x-oss-process=style/preview_120"></image>
        <text style="color:#4bb3ff" v-if="formCommitItem.recordStatus==1">表单有效</text>
        <text style="color:#888" v-if="formCommitItem.recordStatus==0">表单未审核...</text>
      </view>
      <view class="reply" v-if="formCommitItem.reply">
        <text class="replyTitle">平台回复：</text>
        <text class="form_description_text">{{formCommitItem.reply}}</text>
      </view>
      <view class="form_commit_bottom">
        <view class="form_commit_bottom_left">
          <view class="check_record" @click="toFormRewardList" :data-id="formCommitItem.id" v-if="formCommitItem.rewardType!=0"><text>奖励记录</text></view>
        </view>
        <view class="form_commit_bottom_right">
          <image class="form_commit_icon" src="https://image1.sansancloud.com/xianhua/2018_11/14/19/58/37_380.jpg?x-oss-process=style/preview_120"></image>
          <text class="form_commit_time">{{formCommitItem.commitDate}}</text>
          <image @click="checkFormDetail" :data-id="formCommitItem.id" class="form_commit_dot" src="https://image1.sansancloud.com/xianhua/2018_11/14/21/7/48_739.jpg?x-oss-process=style/preview_120"></image>
        </view>
      </view>
    </view>
</block> 
<block v-else-if="formCommitItem&&formListStyle&&formListStyle.length!=0&&!controlLimitState&&bannerList&&setting">
    <view class="form_commit_item" :data-belongformtype="formCommitItem.belongFormType" @click.stop.prevent="checkFormDetail" :data-id="formCommitItem.id">
      <view class="mofang_templete" style="position:relative;width:100%;">
         <view v-for="(itemData,index) in (formListStyle)" :style="'height:'+(itemData.type&&itemData.type==2?'':750/12*itemData.height*(publicFun.toNum(itemData.aspectRatio||1)))+'rpx;position:relative'">
          
              <view v-for="(item,index) in (itemData.data.detailViewMagic)" class="mofang_item" v-if="itemData.type&&itemData.type==1&&itemData.data&&itemData.data.detailViewMagic&&itemData.data.detailViewMagic.length!=0" :style="'position:absolute;overflow:hidden;left:'+(item.startPointX*710/12)+'rpx;top:'+(publicFun.toNum(item.startPointY*710/12)*(publicFun.toNum(itemData.aspectRatio)))+'rpx;width:'+(publicFun.toAbs((item.endPointX-item.startPointX+1)*710/12))+'rpx;height:'+(publicFun.toAbs((item.endPointY-item.startPointY+1)*710/12)*publicFun.toNum(itemData.aspectRatio))+'rpx;'">
                <view class="lunbotu" v-if="item.propertieName&&formCommitItem.commitJson&&formCommitItem.commitJson[item.propertieName]&&formCommitItem.commitJson[item.propertieName].type&&formCommitItem.commitJson[item.propertieName].type==11">
                  <component-tag-banner v-if="bannerList[item.propertieName]&&bannerList[item.propertieName].jsonData.images.length!=0" :data="bannerList[item.propertieName]"></component-tag-banner>  
                </view>
                <view v-if="item.propertieName&&(formCommitItem.commitJson&&formCommitItem.commitJson[item.propertieName]&&formCommitItem.commitJson[item.propertieName].type!=7&&formCommitItem.commitJson[item.propertieName].type!=11)&&(item.placeType==0||item.placeType==3)">
                    <view class="form_detail_center_item" :style="'margin:'+(item.marginBottomTop)+'rpx '+(item.marginNum)+'rpx;height:'+(publicFun.toAbs((item.endPointY-item.startPointY+1)*710/12)*publicFun.toNum(itemData.aspectRatio)-(2*item.marginBottomTop))+'rpx;width:'+(publicFun.toAbs((item.endPointX-item.startPointX+1)*710/12)-(2*item.marginNum))+'rpx;display:flex;background:'+(item.backgroudColor)+';flex-direction:'+(item.placeType==0?'row':'row-reverse')+';align-items:center;justify-content:'+(item.align)+';border-top-width:'+(item.borderTop)+'rpx;border-bottom-width:'+(item.borderBottom)+'rpx;border-left-width:'+(item.borderLeft)+'rpx;border-right-width:'+(item.borderRight)+'rpx;border-color:'+(item.borderColor)+';border-style:solid;padding:'+(item.paddingBottomTop)+'rpx '+(item.paddingNum)+'rpx '+(item.paddingBottomTop)+'rpx '+(item.paddingNum)+'rpx;box-sizing:border-box;border-radius: '+(item.borderRadius)+'rpx;'">
                      <view class="titleStyle">
                        <image v-if="item.propertieIcon" mode="aspectFit" :style="'height:'+(publicFun.toNum(item.titleSize)+2)+'px;width:'+(publicFun.toNum(item.titleSize)+2)+'px;margin-right:12rpx;'" :src="item.propertieIcon"></image>
                        <text class="center_part_item_title" :style="'font-size:'+(item.titleSize)+'px;color:'+(item.titleColor)+';font-weight:'+(item.titleWeight==1?'bold':'0')" v-if="item.propertieName&&formCommitItem.commitJson&&formCommitItem.commitJson[item.propertieName]&&formCommitItem.commitJson[item.propertieName].type!=9&&item.propertiesType==0">{{item.propertieTitle}}</text>
                      </view>
                      <view class="center_part_item_title" :style="'height:100%;width:100%;display:flex;margin:0;background:'+(item.backgroudColor)+';flex-direction:'+(item.placeType==0?'row':'row-reverse')+';align-items:center;justify-content:'+(item.align)" v-if="item.propertiesType==1">
                        <image v-if="item.propertieIcon" mode="aspectFit" :style="'height:'+(publicFun.toAbs((item.endPointY-item.startPointY+1)*710/12)-30)+'rpx;width:'+(publicFun.toAbs((item.endPointY-item.startPointY+1)*710/12)-30)+'rpx;margin-right:12rpx;'" :src="item.propertieIcon"></image>
                        <text :style="'font-size:'+(item.titleSize)+'px;color:'+(item.titleColor)+';padding-bottom:'+(item.borderBottom!=0?'8rpx':'')+';padding-top:'+(item.borderTop!=0?'8rpx':'')+';font-weight:'+(item.titleWeight==1?'bold':'0')">{{item.propertieTitle}}</text>
                      </view>
                      <view class="center_part_item_title" :style="'display:flex;align-items:center;height:100%;width:100%;display:flex;margin:0;background:'+(item.backgroudColor)+';flex-direction:'+(item.placeType==0?'row':'row-reverse')+';align-items:center;justify-content:'+(item.align)" v-if="item.propertiesType==2">
                        <image v-if="item.backgroundImage" mode="aspectFit" style="height:100%;width:100%" :src="item.backgroundImage"></image>
                      </view>
                      <view class="center_part_item_value" :style="'width:'+(formCommitItem.commitJson[item.propertieName].type==4?'60%':'')+';font-size:'+(item.fontSize)+'px;color:'+(item.fontColor)+';font-weight:'+(item.weight==1?'bold':'0')" v-if="formCommitItem.commitJson[item.propertieName]&&formCommitItem.commitJson[item.propertieName].type!=12">
                        <scroll-view class="tags_content" scroll-x v-if="formCommitItem.commitJson[item.propertieName].type==4">
                          <text v-for="(tags,index) in (formCommitItem.commitJson[item.propertieName].value)" :key="tags" class="tags_item" v-if="formCommitItem.commitJson[item.propertieName].value">{{tags}}</text>
                        </scroll-view>
                        <text v-else>{{formCommitItem.commitJson[item.propertieName].value}}</text>
                      </view>
                      <view class="center_part_item_value" :style="'width:80%;font-size:'+(item.fontSize)+'px;color:'+(item.fontColor)+';font-weight:'+(item.weight==1?'bold':'0')" v-if="formCommitItem.commitJson[item.propertieName].type==12">{{formCommitItem.commitJson[item.propertieName].value.value}}</view>
                      <view class="to_navigation" :style="'background:'+(setting.platformSetting.defaultColor)+';color:#fff'" v-if="formCommitItem.commitJson[item.propertieName].type==12" @click.stop.prevent="clickCatch" :data-item="publicFun.toStringFun(formCommitItem.commitJson[item.propertieName].value)">
                        <text>去导航</text>
                      </view>
                    </view>
                </view>
               <view v-if="(!formCommitItem.commitJson[item.propertieName])">
                    <view class="form_detail_center_item" :style="'margin:'+(item.marginBottomTop)+'rpx '+(item.marginNum)+'rpx;height:'+(publicFun.toAbs((item.endPointY-item.startPointY+1)*710/12)*publicFun.toNum(itemData.aspectRatio)-(2*item.marginBottomTop))+'rpx;width:'+(publicFun.toAbs((item.endPointX-item.startPointX+1)*710/12)-(2*item.marginNum))+'rpx;display:flex;background:'+(item.backgroudColor)+';flex-direction:'+(item.placeType==0?'row':'row-reverse')+';align-items:center;justify-content:'+(item.align)+';border-top-width:'+(item.borderTop)+'rpx;border-bottom-width:'+(item.borderBottom)+'rpx;border-left-width:'+(item.borderLeft)+'rpx;border-right-width:'+(item.borderRight)+'rpx;border-color:'+(item.borderColor)+';border-style:solid;padding:'+(item.paddingBottomTop)+'rpx '+(item.paddingNum)+'rpx '+(item.paddingBottomTop)+'rpx '+(item.paddingNum)+'rpx;box-sizing:border-box;border-radius: '+(item.borderRadius)+'rpx;'">
                      <view class="titleStyle">
                        <image v-if="item.propertieIcon" mode="aspectFit" :style="'height:'+(publicFun.toNum(item.titleSize)+2)+'px;width:'+(publicFun.toNum(item.titleSize)+2)+'px;margin-right:12rpx;'" :src="item.propertieIcon"></image>
                        <text class="center_part_item_title" :style="'font-size:'+(item.titleSize)+'px;color:'+(item.titleColor)+';font-weight:'+(item.titleWeight==1?'bold':'0')" v-if="item.propertieName&&formCommitItem.commitJson&&formCommitItem.commitJson[item.propertieName]&&formCommitItem.commitJson[item.propertieName].type!=9&&item.propertiesType==0">{{item.propertieTitle}}</text>
                      </view>
                      <view class="center_part_item_title" :style="'height:100%;width:100%;display:flex;margin:0;background:'+(item.backgroudColor)+';flex-direction:'+(item.placeType==0?'row':'row-reverse')+';align-items:center;justify-content:'+(item.align)" v-if="item.propertiesType==1">
                        <image v-if="item.propertieIcon" mode="aspectFit" :style="'height:'+(publicFun.toAbs((item.endPointY-item.startPointY+1)*710/12)-30)+'rpx;width:'+(publicFun.toAbs((item.endPointY-item.startPointY+1)*710/12)-30)+'rpx;margin-right:12rpx;'" :src="item.propertieIcon"></image>
                        <text :style="'font-size:'+(item.titleSize)+'px;color:'+(item.titleColor)+';padding-bottom:'+(item.borderBottom!=0?'8rpx':'')+';padding-top:'+(item.borderTop!=0?'8rpx':'')+';font-weight:'+(item.titleWeight==1?'bold':'0')">{{item.propertieTitle}}</text>
                      </view>
                      <view class="center_part_item_title" :style="'display:flex;align-items:center;height:100%;width:100%;display:flex;margin:0;background:'+(item.backgroudColor)+';flex-direction:'+(item.placeType==0?'row':'row-reverse')+';align-items:center;justify-content:'+(item.align)" v-if="item.propertiesType==2">
                        <image v-if="item.backgroundImage" mode="aspectFit" style="height:100%;width:100%" :src="item.backgroundImage"></image>
                      </view>
                    </view>
                </view>
                <view v-if="item.propertieName&&formCommitItem.commitJson&&formCommitItem.commitJson[item.propertieName]&&(formCommitItem.commitJson[item.propertieName].type!=7&&formCommitItem.commitJson[item.propertieName].type!=11)&&(item.placeType==1||item.placeType==2)">
                    <view class="form_detail_center_item" :style="'height:'+(publicFun.toAbs((item.endPointY-item.startPointY+1)*710/12)*publicFun.toNum(itemData.aspectRatio)-(2*item.marginBottomTop))+'rpx;width:'+(publicFun.toAbs((item.endPointX-item.startPointX+1)*710/12)-(2*item.marginNum))+'rpx;display:flex;margin:0;background:'+(item.backgroudColor)+';flex-direction:'+(item.placeType==1?'column':'column-reverse')+';align-items:'+(item.align)+';justify-content:center;border-top-width:0rpx;border-bottom-width:0rpx;border-left-width:'+(item.borderLeft)+'rpx;border-right-width:'+(item.borderRight)+'rpx;border-color:'+(item.borderColor)+';border-style:solid;padding:'+(item.paddingBottomTop)+'rpx '+(item.paddingNum)+'rpx '+(item.paddingBottomTop)+'rpx '+(item.paddingNum)+'rpx;box-sizing:border-box;'">
                      <view class="titleStyle">
                        <image v-if="item.propertieIcon" mode="aspectFit" :style="'height:'+(publicFun.toNum(item.titleSize)+2)+'px;width:'+(publicFun.toNum(item.titleSize)+2)+'px;margin-right:12rpx;'" :src="item.propertieIcon"></image>
                        <text class="center_part_item_title" :style="'font-size:'+(item.titleSize)+'px;color:'+(item.titleColor)+';font-weight:'+(item.titleWeight==1?'bold':'0')" v-if="item.propertieName&&formCommitItem.commitJson[item.propertieName].type!=9&&item.propertiesType==0">{{item.propertieTitle}}</text>
                      </view>
                      <view class="center_part_item_title" :style="'font-size:'+(item.titleSize)+'px;color:'+(item.titleColor)+';font-weight:'+(item.titleWeight==1?'bold':'0')" v-if="item.propertiesType==1">
                        <image mode="aspectFit" style :src="item.propertieIcon"></image>
                        <text>{{item.propertieTitle}}</text>
                      </view>
                      <view class="center_part_item_title" v-if="item.propertiesType==2">
                        <image mode="aspectFit" style="width:100%" :src="item.backgroundImage"></image>
                      </view>
                      <view class="center_part_item_value" :style="'font-size:'+(item.fontSize)+'px;color:'+(item.fontColor)+';font-weight:'+(item.weight==1?'bold':'0')" v-if="formCommitItem.commitJson[item.propertieName].type!=12">
                        <scroll-view class="tags_content" scroll-x v-if="item.propertieName&&formCommitItem.commitJson[item.propertieName].type==4">
                          <text v-for="(tags,index) in (formCommitItem.commitJson[item.propertieName].value)" :key="tags" class="tags_item" v-if="formCommitItem.commitJson[item.propertieName].value">{{tags}}</text>
                        </scroll-view>
                        <text v-else>{{formCommitItem.commitJson[item.propertieName].value}}</text>
                      </view>
                      <text class="center_part_item_value" :style="'font-size:'+(item.fontSize)+'px;color:'+(item.fontColor)+';font-weight:'+(item.weight==1?'bold':'0')" v-if="item.propertieName&&formCommitItem.commitJson[item.propertieName].type==12">{{formCommitItem.commitJson[item.propertieName].value.value}}</text>
                      <view class="to_navigation" :style="'background:'+(setting.platformSetting.defaultColor)+';color:#fff'" v-if="item.propertieName&&formCommitItem.commitJson[item.propertieName].type==12" @click.stop.prevent="clickCatch" :data-item="publicFun.toStringFun(formCommitItem.commitJson[item.propertieName].value)">
                        <text>去导航</text>
                      </view>
                    </view>  
                </view>
                <view style="width:100%;height:100%">
                  <image mode="aspectFill" :src="formCommitItem.commitJson[item.propertieName].value[0]" :data-link="formCommitItem.commitJson[item.propertieName].value[0]" @click="tolinkUrl" :style="'border-radius: '+(item.borderRadius)+'px;width:100%;height:100%;padding:'+(imagePadding)+'rpx;box-sizing:border-box'" v-if="item.propertieName&&formCommitItem.commitJson&&formCommitItem.commitJson[item.propertieName]&&formCommitItem.commitJson[item.propertieName].type==7&&(publicFun.toTypeof(formCommitItem.commitJson[item.propertieName].value)=='object')"></image>
                  <image mode="aspectFill" :src="formCommitItem.commitJson[item.propertieName].value" :data-link="formCommitItem.commitJson[item.propertieName].value" @click="tolinkUrl" :style="'border-radius: '+(item.borderRadius)+'px;width:100%;height:100%;padding:'+(imagePadding)+'rpx;box-sizing:border-box'" v-if="item.propertieName&&formCommitItem.commitJson&&formCommitItem.commitJson[item.propertieName]&&formCommitItem.commitJson[item.propertieName].type==7&&(publicFun.toTypeof(formCommitItem.commitJson[item.propertieName].value)=='string')"></image> 
                </view>
              </view> 
          
          
          <view v-if="itemData.type&&itemData.type==2">
            <view :style="'display:flex;margin:0;background:'+(itemData.data.backgroudColor)+';flex-direction:'+(itemData.data.placeType==1?'column':'column-reverse')+';align-items:'+(itemData.data.align)+';justify-content:center;border-top-width:0rpx;border-bottom-width:0rpx;border-left-width:'+(itemData.data.borderLeft)+'rpx;border-right-width:'+(itemData.data.borderRight)+'rpx;border-color:'+(itemData.data.borderColor)+';border-style:solid;padding:'+(itemData.data.paddingBottomTop)+'rpx '+(itemData.data.paddingNum)+'rpx;margin:'+(itemData.data.marginBottomTop)+'rpx '+(itemData.data.marginNum)+'rpx;border-radius: '+(itemData.data.borderRadius)+'rpx;font-size:'+(itemData.data.fontSize)+'px;color:'+(itemData.data.fontColor)+';font-weight:'+(itemData.data.weight==1?'bold':'0')">
              
              <view v-if="item.propertieName&&formCommitItem.commitJson[itemData.data.propertieName].type==9" class="rich_describe">
                <text>{{formCommitItem.commitJson[itemData.data.propertieName].value}}</text>
                
             </view>
              <text v-else>{{formCommitItem.commitJson[itemData.data.propertieName].value}}</text>
            </view>
          </view>
         </view>
      </view>
    </view>  
</block>
<block v-else-if="formCommitItem&&formDetail&&formDetail.renderTemplateName=='pyq'&&setting">
    <view class="circle_item">
      <image class="circle_user_icon" :src="formCommitItem.commitPlatformUserIcon"></image>
      <view class="circle_base_info">
          <view class="circle_user_top">
              <text class="circle_user_name">{{formCommitItem.commitPlatformUserName}}</text>
              <image class="circle_share_icon" @click="judgeFun" :data-itemData="publicFun.toStringFun(formCommitItem)" src="https://image1.sansancloud.com/xianhua/2020_4/7/11/20/19_376.jpg?x-oss-process=style/preview_120"></image>
          </view>
          <rich-text class="circle_user_rich" :nodes="formCommitItem.commitJson.title.value"></rich-text>
          <view class="log_item_img_list" style="margin: 0;" v-if="formCommitItem.commitJson.moreImg.value&&formCommitItem.commitJson.moreImg.value.length!=0">
              <view v-for="(imgItem,imgIndex) in (formCommitItem.commitJson.moreImg.value)" :key="imgItem.imgIndex" class="log_item_img_item" v-if="formCommitItem.commitJson.moreImg.value.length>2" @click="lookBigImage" :data-imageUrl="publicFun.toString(formCommitItem.commitJson.moreImg.value)" :data-index="imgIndex">
                  <image class="img_item" mode="aspectFill" :src="imgItem.imageUrl"></image>
              </view>
              <view v-for="(imgItem,imgIndex) in (formCommitItem.commitJson.moreImg.value)" :key="imgItem.imgIndex" class="log_item_img_item" style="width: 280rpx;height: 280rpx;" v-if="formCommitItem.commitJson.moreImg.value.length==2" @click="lookBigImage" :data-imageUrl="publicFun.toString(formCommitItem.commitJson.moreImg.value)" :data-index="imgIndex">
                  <image class="img_item" mode="aspectFill" :src="imgItem.imageUrl"></image>
              </view>
              <view v-for="(imgItem,imgIndex) in (formCommitItem.commitJson.moreImg.value)" :key="imgItem.imgIndex" class="log_item_img_item" style="height: 100%;" v-if="formCommitItem.commitJson.moreImg.value.length==1" @click="lookBigImage" :data-imageUrl="publicFun.toString(formCommitItem.commitJson.moreImg.value)" :data-index="imgIndex">
                  <image class="img_item" mode="widthFix" :src="imgItem.imageUrl"></image>
              </view>
          </view>
          <view class="circle_bottom">
              <text class="circle_time">{{formCommitItem.commitDate}}</text>
              <view class="circle_fun" @click="toCommentFun" :data-itemData="publicFun.toStringFun(formCommitItem)" v-if="(!componentState)">
                  <image mode="aspectFit" src="https://image1.sansancloud.com/jianzhan/2019_3/13/17/6/38_907.jpg?x-oss-process=style/preview_120" class="circle_fun_icon"></image>
              </view>
          </view>
          
          <view class="comments_block" v-if="conmmentList.length!=0&&!componentState">
              <view v-for="(conmmentItem,conmmentIndex) in (conmmentList)" :key="conmmentItem.conmmentIndex" class="comments_item">
                  <view class="comments_value">
                      <text class="cover_user_name" @click="toCommentFun" :data-itemData="conmmentItem" data-type="recomment">{{conmmentItem.commentUserName}}: </text>
                      
                      <text class="comments_user_name">{{conmmentItem.commentUserName}}: {{conmmentItem.comment}}</text>
                  </view>
                  <block v-if="conmmentItem.recomments&&conmmentItem.recomments.length!=0">
                      <view v-for="(conmmentChilrenItem,conmmentChilrenIndex) in (conmmentItem.recomments)" :key="conmmentChilrenItem.conmmentIndex" class="comments_value_chilren">
                          <view class="comments_value">
                              <view class="cover_user_name" style="color: #000;">
                                  <text class="cover_user_name" style="right: 0;left: unset;" @click="toCommentFun" :data-itemData="conmmentItem" data-type="recomment">{{conmmentItem.commentUserName}}</text>
                                  <text class="cover_user_name" @click="toCommentFun" :data-itemData="conmmentChilrenItem" data-type="recomment">{{conmmentChilrenItem.commentUserName}}</text>
                                  {{conmmentChilrenItem.commentUserName}}回复{{conmmentItem.commentUserName}}
                              </view>
                              <text class="comments_user_name">{{conmmentChilrenItem.commentUserName}}回复{{conmmentItem.commentUserName}}: {{conmmentChilrenItem.comment}}</text>
                          </view>
                      </view>
                  </block>
              </view>
          </view>
      </view>
    </view>
</block>
<block v-else-if="formCommitItem&&setting">
    <view class="form_commit_item_info" :data-belongformtype="formCommitItem.belongFormType" @click.stop.prevent="checkFormDetail" :data-id="formCommitItem.id">
      <view class="top_part">
        <view class="top_part_left">
          <image class="top_part_left_img" :src="formCommitItem.commitPlatformUserIcon?formCommitItem.commitPlatformUserIcon+'?x-oss-process=style/preview_120':''" :data-link="'chat_room.html?puid='+(formCommitItem.commitPlatformUserId)+'&puname='+(formCommitItem.commitPlatformUserName)" @click.stop.prevent="tolinkUrl"></image>
          <view class="user_base_info">
            <text class="user_base_info_name" :data-link="'chat_room.html?puid='+(formCommitItem.commitPlatformUserId)+'&puname='+(formCommitItem.commitPlatformUserName)" @click.stop.prevent="tolinkUrl">{{formCommitItem.commitPlatformUserName}}</text>
            <view class="user_base_info_type">
              <text class="user_base_info_type_name" :style="'background:'+(setting.platformSetting.defaultColor)">{{formCommitItem.belongFormName}}</text>
              <view class="form_reward_status" v-if="controlLimitState">
                <text class="form_reward_status_item" :style="'background:'+(setting.platformSetting.defaultColor)" v-if="formCommitItem.recordStatus==1">有效表单</text>
                <text class="form_reward_status_item" style="background:#999" v-if="formCommitItem.recordStatus==2">无效表单</text>
                <text class="form_reward_status_item" style="background:#999" v-if="formCommitItem.recordStatus==0">待审核表单</text>
              </view>
            </view>
          </view>
        </view>
        <view class="top_part_right" v-if="controlLimitState">
          <image class="more_icon" v-if="(!formCommitItem.showFunState)" @click.stop.prevent="showMoreFun" data-type="show" src="https://image1.sansancloud.com/xianhua/2019_5/30/19/48/32_954.jpg?x-oss-process=style/preview_120"></image>
          <image class="more_icon" v-else @click.stop.prevent="showMoreFun" data-type="hidden" src="https://image1.sansancloud.com/xianhua/2019_5/30/20/22/55_904.jpg?x-oss-process=style/preview_120"></image>
          <view class="fun_list" v-if="formCommitItem.showFunState">
            <view class="fun_item" @click.stop.prevent="replyTextStateFun" data-type="show">
              <image class="fun_item_icon" src="https://image1.sansancloud.com/xianhua/2019_5/30/19/57/40_527.jpg?x-oss-process=style/preview_120"></image>
              <text style="letter-spacing:22rpx;">回复</text>
            </view>
            <view class="fun_item" @click.stop.prevent="setStateFun" data-commitStatus="1" v-if="formCommitItem.recordStatus==0">
              <image class="fun_item_icon" src="https://image1.sansancloud.com/xianhua/2019_5/30/19/57/40_519.jpg?x-oss-process=style/preview_120"></image>
              <text>置有效</text>
            </view>
            <view class="fun_item" @click.stop.prevent="setStateFun" data-commitStatus="2" v-if="formCommitItem.recordStatus==0">
              <image class="fun_item_icon" src="https://image1.sansancloud.com/xianhua/2019_5/30/19/57/40_557.jpg?x-oss-process=style/preview_120"></image>
              <text>置无效</text>
            </view>
          </view>
        </view>
      </view>
      <view class="center_part">
        <view v-for="(itemData,idx) in (formCommitItem.commitArr)" :key="itemData.id" class="center_part_item" v-if="itemData.type&&itemData.type!=11&&itemData.type!=7&&idx<=formCommitItem.showNum&&itemData.showInList==1">
          <text class="center_part_item_title" v-if="itemData.type&&itemData.type!=9">{{itemData.title}}</text>
          <text class="interval" v-if="itemData.type&&itemData.type!=9">:</text>
          <rich-text class="center_part_item_value" v-if="itemData.type&&itemData.type!=12" :nodes="itemData.value"></rich-text>
          
          <text class="center_part_item_value" v-if="itemData.type&&itemData.type==12">{{itemData.value.value}}</text>
          <view class="more" v-if="formCommitItem.lengthStr>3&&idx==formCommitItem.showNum-2&&formCommitItem.showMoreState">
            <image class="showMore" :data-index="idx" data-type="hidden" @click.stop.prevent="showMore" src="https://image1.sansancloud.com/xianhua/2019_3/20/11/1/46_412.jpg?x-oss-process=style/preview_120"></image>
          </view>
          <view class="more" v-if="formCommitItem.lengthStr>=3&&idx==formCommitItem.showNum&&!formCommitItem.showMoreState">
            <image class="showMore" :data-index="idx" :data-length="formCommitItem.lengthStr" data-type="show" @click.stop.prevent="showMore" src="https://image1.sansancloud.com/xianhua/2019_3/20/11/1/46_428.jpg?x-oss-process=style/preview_120"></image>
          </view>
        </view>
        <view v-for="(itemData,index) in (formCommitItem.commitArr)" :key="itemData.id" class="show_img" v-if="itemData.type&&itemData.type==7&&itemData.value">
          <image v-for="(img,index) in (itemData.value)" :key="img.index" class="show_img_item" mode="aspectFill" :src="img" v-if="publicFun.typeOf(itemData.value)!='string'"></image>
          <image class="show_img_item" mode="aspectFill" :src="itemData.value" v-if="publicFun.typeOf(itemData.value)=='string'"></image>
        </view>
        <view v-for="(itemData,index) in (formCommitItem.commitArr)" :key="itemData.id" class="show_img" v-if="itemData.type&&itemData.type==11&&itemData.value">
          <image v-for="(img,index) in (itemData.value)" :key="img.index" class="show_img_item" mode="aspectFill" :src="img"></image>
        </view>
        <view class="addr_time">
          <view class="addr_con">
          </view>
          <text class="time_con">{{formCommitItem.commitDate}}</text>
        </view>
      </view>
      <view class="reply_block" v-if="formCommitItem.reply">
          
        <text style="width:18%;white-space:nowrap;">回复内容：</text>
        <text>「"{{formCommitItem.reply}}"」</text>
      </view>
    </view>
    <view class="zhezhao" v-if="formCommitItem.showFunBan"></view>
    <view class="reply_popup" v-if="formCommitItem.showFunBan">
      <text class="reply_popup_title">回复表单</text>
       <textarea class="reply_text" name="content" maxlength="200" placeholder="请写下您的意见..." value @input="bindTextAreaBlur"></textarea>
       <view class="reply_popup_fun">
         <view class="reply_popup_fun_btn" @click.stop.prevent="replyTextStateFun" data-type="hidden">
           <text>取消</text>
         </view>
         <view class="reply_popup_fun_btn" @click.stop.prevent="replyTextData">
           <text>回复</text>
         </view>
       </view>
    </view>
</block></uni-shadow-root>
</template>
<wxs src="../../public/publicFun.wxs" module="publicFun"></wxs>
<script>
import ComponentTagBanner from '../banner/banner.vue'
global['__wxVueOptions'] = {components:{'component-tag-banner': ComponentTagBanner}}

global['__wxRoute'] = 'partials/form_item/index'
const app = getApp();
Component({
  properties: {
    receiveData: {
      type: JSON,
      value: '',
    },
    componentState:{
      type: Boolean,
      value: true,
    },
    formDetail:{
      type: JSON,
      value: '',
    },
    formListStyle: {
      type: JSON,
      value: '',
    },
    controlLimitState: {
      type: JSON,
      value: '',
    },
  },
  data: {
    setting: null, 
    formCommitItem:{},
    width:0,
    height:0,
    replyText:"",
    bannerList:null,
    conmmentList:[],
  },
  ready: function () {
    let that = this;
    console.log("====form-item-formCommitItem======", that.data.receiveData);
    console.log("====form-item-formListStyle=====", that.data.formListStyle);
    console.log("====form-item-controlLimitState=====", that.data.controlLimitState);
    console.log("====form-item-formDetail=====", that.data.formDetail);
    console.log("====form-item-componentState=====", that.data.componentState);
    that.initData('init')
    that.setData({
      setting: app.globalData.setting,
    })
  },
  methods: {
    initData: function (data) {
      console.log("=========initData========", data)
      let that = this;
      let reqData;
      if (typeof (that.data.receiveData) == 'object') {
        reqData = that.data.receiveData
      } else {
        reqData = JSON.parse(that.data.receiveData)
      }
      that.getCommentData(that.data.receiveData.id,1)
      reqData.showFunState = false;
      reqData.showFunBan = false;
      let commitJson = reqData.commitJson
      let bannerList = that.data.bannerList||[];
      let formListStyle = that.data.formListStyle
      for (let i in commitJson){
        if (commitJson[i]&&commitJson[i].type == 11){
            console.log("==console.log(commitJson[i])==",commitJson[i])
          bannerList[i]={
            androidTemplate:"form_more_banner",
            jsonData:{ 
               images: commitJson[i].value||'',
               height:'0.3',
            }
          }
        }
      }
      for(let j in bannerList){
          if(bannerList[j].jsonData.images.length!=0){
              for(let k=0;k<bannerList[j].jsonData.images.length;k++){
                  let url=bannerList[j].jsonData.images[k]
                  let obj={}
                  obj.width=150;
                  obj.imageUrl=url
                  bannerList[j].jsonData.images[k]=obj
              }
          }
      }
      console.log("=====bannerList======", bannerList)
      if (formListStyle&&formListStyle.length!=0){
        for (let i = 0; i < formListStyle.length; i++) {
          if (formListStyle[i].data.detailViewMagic && formListStyle[i].data.detailViewMagic.length != 0) {
            let detailViewMagic = formListStyle[i].data.detailViewMagic
            for (let j = 0; j < detailViewMagic.length; j++) {
              for (let key in bannerList) {
                if (detailViewMagic[j].propertieName == key) {
                  bannerList[key].jsonData.height = Math.abs(detailViewMagic[j].startPointY - detailViewMagic[j].endPointY) / Math.abs(detailViewMagic[j].startPointX - detailViewMagic[j].endPointX)
                }
              }
            }
          }
        }
      }
      that.setData({ bannerList: bannerList , formCommitItem: reqData, })
      console.log("=====databannerList======", that.data.bannerList,reqData)
      if (that.data.formListStyle) {
        that.setData({ width: Number(that.data.formListStyle.width) || 0 })
        that.setData({ height: Number(that.data.formListStyle.height) || 0 })
      }
    },
    replyTextStateFun:function(e){
      console.log("=========replyTextStateFun=====")
      let that = this;
      let type = e.currentTarget ? e.currentTarget.dataset.type : e;
      let state = (type == "show" ? true : false);
      that.data.formCommitItem.showFunBan = state
      that.setData({ formCommitItem: that.data.formCommitItem })
    },
    bindTextAreaBlur:function(e){
      console.log("=====bindTextAreaBlur====", e);
      let that=this;
      let value = e.detail.value;
      that.setData({ replyText: value})
    },
    replyTextData:function(){
      console.log("=====replyTextData====");
      let that = this;
      let params = {
        reply: that.data.replyText,
        commitId: that.data.formCommitItem.id
      }
      var customIndex = app.globalData.AddClientUrl("/super_shop_manager_reply_custom_form_commit.html", params)
      app.globalData.showToastLoading('loading', true)
      wx.request({
        url: customIndex.url,
        header: app.globalData.header,
        success: function (res) {
          wx.hideLoading()
          console.log("setStateFun", res.data)
          that.showMoreFun("hidden")
          that.replyTextStateFun('hidden')
          if (res.data.errcode == 0) {
            that.data.formCommitItem.reply = res.data.relateObj.reply
            that.setData({ formCommitItem: that.data.formCommitItem })
          } else {
            wx.showToast({
              title: res.data.errMsg,
              image: '/wxcomponents/images/icons/tip.png',
            })
          }
        },
        fail: function (res) {
          console.log("fail")
          wx.hideLoading()
          app.globalData.loadFail()
        }
      })
    },
    setStateFun:function(e){
      console.log("=====setStateFun====", e);
      let that=this;
      let commitStatus = e.currentTarget.dataset.commitstatus;
      let params={
        commitStatus: commitStatus,
        commitId: that.data.formCommitItem.id
      }
      var customIndex = app.globalData.AddClientUrl("/super_shop_manager_set_commit_form_flag.html", params)
      app.globalData.showToastLoading('loading', true)
      wx.request({
        url: customIndex.url,
        header: app.globalData.header,
        success: function (res) {
          wx.hideLoading()
          console.log("setStateFun", res.data)
          if (res.data.errcode==0){
            that.showMoreFun("hidden")
            that.data.formCommitItem.recordStatus = res.data.relateObj.recordStatus
            that.setData({ formCommitItem: that.data.formCommitItem})
          }else{
            wx.showToast({
              title: res.data.errMsg,
              image: '/wxcomponents/images/icons/tip.png',
            })
          }
        },
        fail: function (res) {
          console.log("fail")
          wx.hideLoading()
          app.globalData.loadFail()
        }
      })
    },
    showMoreFun:function(e){
      console.log("=====showMoreFun====", e)
      let that = this;
      let type = e.currentTarget ? e.currentTarget.dataset.type:e;
      let state = (type == "show" ? true : false);
      that.data.formCommitItem.showFunState = state
      that.setData({ formCommitItem: that.data.formCommitItem })
    },
    showMore: function (e) {
      console.log("==showMore===", e)
      let that = this;
      let type = e.currentTarget.dataset.type;
      let length = e.currentTarget.dataset.length || 2;
      let state = (type == "show" ? true : false);
      let showNum = type == "show" ? length : 2;
      that.data.formCommitItem.showMoreState = state
      that.data.formCommitItem.showNum = showNum
      that.setData({ formCommitItem: that.data.formCommitItem })
    },
    calling: function (e) {
      console.log('====e===', e)
      let phoneNumber = e.currentTarget.dataset.phonenumber
      wx.makePhoneCall({
        phoneNumber: phoneNumber,
        success: function () {
          console.log("拨打电话成功！")
        },
        fail: function () {
          console.log("拨打电话失败！")
        }
      })
    },
    checkFormDetail: function (data) {
      let that = this;
      console.log("====data===", data)
      let formId = data.currentTarget.dataset.id ? data.currentTarget.dataset.id : 0;
      let belongFormType = data.currentTarget.dataset.belongformtype ? data.currentTarget.dataset.belongformtype : 0;
      if (belongFormType == 0) {
        console.log("普通表单")
        wx.showActionSheet({
          itemList: ['查看用户提交的表单'],
          success: function (res) {
            console.log(res.tapIndex)
            if (!formId) {
              wx.showModal({
                title: '提示',
                content: '主人~该表单没有内容哦!',
                success: function (res) {
                  if (res.confirm) {
                    console.log('用户点击确定')
                  } else if (res.cancel) {
                    console.log('用户点击取消')
                  }
                }
              })
            } else {
              let url = "check_form_detail.html?custom_form_commit_id=" + formId
              that.tolinkUrl(url)
            }
          },
          fail: function (res) {
            console.log(res.errMsg)
          }
        })
      } else {
        console.log("信息发布表单")
        if (!formId) {
          wx.showModal({
            title: '提示',
            content: '主人~该表单没有内容哦!',
            success: function (res) {
              if (res.confirm) {
                console.log('用户点击确定')
              } else if (res.cancel) {
                console.log('用户点击取消')
              }
            }
          })
        } else {
          let url = "check_form_detail.html?custom_form_commit_id=" + formId
          that.tolinkUrl(url)
        }
      }
    },
    // 定位
    clickCatch: function (e) {
      console.log("===定位====", e)
      let itemData = e.currentTarget.dataset.item;
      if(itemData&&itemData!=""){
          itemData=JSON.parse(itemData)
      }
      let latitude = itemData.latitude;
      let longitude = itemData.longitude;
      let name = itemData.value;
      let address = itemData.value
      wx.openLocation({
        latitude: latitude,
        longitude: longitude,
        scale: 12,
        name: name,
        address: address
      })
    },
    //获取产品分类
    getOrganizesType: function (parentCategoryId, categoryId, callback) {
      var customIndex = app.globalData.AddClientUrl("/wx_get_categories_only_by_parent.html", { categoryId: parentCategoryId })
      app.globalData.showToastLoading('loading', true)
      var that = this
      wx.request({
        url: customIndex.url,
        header: app.globalData.header,
        success: function (res) {
          wx.hideLoading()
          console.log("getOrganizesType", res.data)
          if (res.data.errcode == 0) {
            that.setData({ organizesType: res.data.relateObj })
          } else {
            that.setData({ organizesType: that.data.organizesType })
          }
          that.data.organizesType.unshift({ id: categoryId || parentCategoryId, name: "全部" })
          for (let i = 0; i < that.data.organizesType.length; i++) {
            that.data.organizesType[i].colorAtive = '#888';
          }
          that.data.organizesType[0].colorAtive = that.data.setting.platformSetting.defaultColor;
          that.data.organizesType[0].active = true;
          that.setData({ organizesType: that.data.organizesType })
          wx.hideLoading()
        },
        fail: function (res) {
          console.log("fail")
          wx.hideLoading()
          app.globalData.loadFail()
        }
      })
    },
    toIndex() {
      app.globalData.toIndex()
    },
    tolinkUrl: function (data) {
      let linkUrl = data.currentTarget ? data.currentTarget.dataset.link : data;
      console.log("==linkUrl===", linkUrl)
      app.globalData.linkEvent(linkUrl)
    },
    onPullDownRefresh: function () {
      this.data.params.name = ""
      this.data.listPage.page = 1
      this.data.params.page = 1
      this.getData(this.data.params)
    },
    onReachBottom: function () {
      var that = this
      if (that.data.listPage.totalSize > that.data.listPage.curPage * that.data.listPage.pageSize) {
        that.data.listPage.page++
        that.data.params.page++
        that.getData(that.data.params);
      }
    },
    judgeFun:function(e){
        let that=this;
        console.log("==judgeFun==",e)
        let itemData=e.currentTarget.dataset.itemdata;
        wx.showModal({
          title: '提示',
          content: '您确定要复制文本和下载图片吗？',
          success: function (res) {
            if (res.confirm) {  
              console.log('点击确认回调')
              that.shareFormItemFun(itemData)
            } else {   
              console.log('点击取消回调')
            }
          }
        })
    },
    // 朋友圈样式方法
    shareFormItemFun:function(data){
        let that=this;
        let itemData=JSON.parse(data)
        let imgList=itemData.commitJson.moreImg.value;
        let value=itemData.commitJson.title.value;
        console.log("shareFormItemFun",itemData,imgList);
        if(value){
            wx.setClipboardData({
              data: value,
              success: function (res) {
                wx.getClipboardData({
                  success: function (res) {
                    wx.showToast({
                      title: '复制文本成功',
                      icon: 'success',
                      duration: 1000
                    });
                  }
                });
              }
            });
        }
        wx.authorize({
         scope: 'scope.writePhotosAlbum',
         success:function(e){
            console.log("success",e)
            setTimeout(function(){
                if(imgList&&imgList.length!=0){
                    for (let i = 0; i < imgList.length;i++){
                      that.downloadImg(imgList[i], imgList.length, i)
                    }
                }
            },1000)
         },
         fail:function(e){
            console.log("fail",e)
         },
        })
    },
    downloadImg: function(url,lengthStr,index){　　　　　　　　　　　　　　　　//触发函数
        console.log(url,lengthStr,index)
        if(url&&url.imageUrl){
            url.imageUrl=url.imageUrl.replace('http://','https://');
        }
        wx.showLoading({
            title: '图片下载中..',
        })
        wx.downloadFile({
          url: url.imageUrl,　　　　　　　//需要下载的图片url
          success: function (res) {　　　　　　　　　　　　//成功后的回调函数
            wx.saveImageToPhotosAlbum({　　　　　　　　　//保存到本地
              filePath: res.tempFilePath,
              success(res) {
                wx.hideLoading();
                wx.showToast({
                  title: '下载图片成功',
                  icon: 'success',
                  duration: 2000
                })
              },
              fail: function (err) {
                wx.hideLoading();
                if (err.errMsg === "saveImageToPhotosAlbum:fail auth deny") {
                  wx.openSetting({
                    success(settingdata) {
                      console.log(settingdata)
                      if (settingdata.authSetting['scope.writePhotosAlbum']) {
                        console.log('获取权限成功，给出再次点击图片保存到相册的提示。')
                      } else {
                        console.log('获取权限失败，给出不给权限就无法正常使用的提示')
                      }
                    }
                  })
                }
              }
            })
          }
        });
    },
    lookBigImage: function (e) {
      console.log("111111111", e.currentTarget.dataset);
      let imgSrc = e.currentTarget.dataset.imageurl;
      let imgArray = [];
      let index = e.currentTarget.dataset.index;
      let PostImageSrc = [];
      console.log(imgSrc);
      if(imgSrc&&imgSrc!=""){
          imgSrc=JSON.parse(imgSrc)
      }
      for (let i = 0; i < imgSrc.length; i++) {
        imgArray.push(imgSrc[i].imageUrl);
        PostImageSrc.push(imgSrc[i].imageUrl.replace(/http/, "https"));
      } 
      console.log(PostImageSrc);
      if (!imgSrc) {
        return;
      }
      wx.previewImage({
        current: imgArray[index],
        // 当前显示图片的http链接
        urls: imgArray // 需要预览的图片http链接列表

      });
    },
    //获取评论数据
    getCommentData: function (customFormInstanceId, page) {
      let that = this;
      let data = {
        customFormInstanceId: customFormInstanceId,
        page: page
      }
      let customIndex = getApp().globalData.AddClientUrl("/get_news_bbs_comments.html", data)
      wx.request({
        url: customIndex.url,
        data: customIndex.params,
        header: getApp().globalData.header,
        success: function (res) {
          console.log('====sssssss===', res)
          let conmmentList=that.conmmentList
          if (page == 1) {
            conmmentList=res.data.relateObj.result
          } else {
            console.log("====more page====");
            conmmentList=conmmentList.concat(res.data.relateObj.result)
          }
          that.setData({conmmentList:conmmentList})
          console.log("==that.conmmentList===",that.conmmentList);
        },
        fail: function (res) {//获取数据失败就会进入这个方法
          wx.hideLoading()
        }
      })
    },
    toCommentFun:function(e){
        let that=this;
        let itemData=e.currentTarget.dataset.itemdata||''
        let type=e.currentTarget.dataset.type||''
        that.triggerEvent('toComment', {itemData:itemData,type:type})
    },
  }
})
export default global['__wxComponents']['partials/form_item/index']
</script>
<style platform="mp-weixin">
@import 'form_item_one/index.css';
@import 'form_item_two/index.css';
@import 'form_item_decorated/index.css';
@import 'form_item_pyq/index.css';
</style>